package com.virus.coronavirus.service;

import com.virus.coronavirus.error.SystemException;
import com.virus.coronavirus.model.Area;
import com.virus.coronavirus.model.Track;
import com.virus.coronavirus.model.vo.AreaArriveVO;
import com.virus.coronavirus.model.vo.CompareVO;
import com.virus.coronavirus.model.vo.MeetVO;
import com.virus.coronavirus.model.vo.TrackVO;

import java.util.List;

/**
 * @Author: Bbeginner
 * @Date: 2021/2/4 13:47
 * @Version 1.0
 **/
public interface TrackService {

    /**
     * show all track data
     * @return
     */
    List<Track> selectList();


    public List<Track> findTrackBySim(Integer sim);

    /**
     * 添加用户轨迹信息
     * @param
     */
//    Track add(Long userId,Double lng,Double lat,String time,String track_name) throws SystemException;
    void add(TrackVO trackVO) throws SystemException;

    //查询一个用户在一天至另一天时间内的轨迹信息
    List<Track> findTrackByTime (Long id, String time1,String time2)
            throws Exception;

    //查询一个用户在一天至另一天时间内的轨迹信息
    List<Track> findOnesTrackSomeday (Long id, String time)
            throws Exception;

    //筛选一段时间内的轨迹
    List<Track> selectTrackByTime(List<Track> tracks,String time,String time2);


    //筛选一段时间内的轨迹
    List<Track> selectTrackByTime(String time1,String time2);

    //筛选一段时间内的轨迹,以天为单位
    public List<Track> findEveryonesTrackByTime(String time1,String time2)
            throws Exception;

    //精确到秒
    public List<Track> findEveryonesTrackByTime2(String time1,String time2)
            throws Exception;

    //精确到秒,精确到个人
    public List<Track> findonesTrackByTime2(Long id,String time1,String time2)
            throws Exception;

    //查询一个用户在前几天时间内的轨迹信息
    List<Track> findTrackById(Long id,Integer days);


    //找到一个人的所有轨迹，通过userId
    public List<Track> getTracksOfOne(Long userId);

    //更新某条轨迹
    public Track update(Long trackid,Double lat,Double lng,String time,String trackname)throws Exception;

    //获取单条轨迹信息
    Track findonetrack(Long trackId);

    Area findarea(Long id);


    // 一个范围内所有的轨迹
    List<Track> selectTrackByPlace(List<Track> tracks,Double lng1, Double lat1,
                                   Double lng2, Double lat2);

    /**
     *一个地点范围内所有的用户轨迹
     * @param lng1
     * @param lat1
     * @param lng2
     * @param lat2
     */
    List<Track> trackplaceall(Double lng1, Double lat1,
                                  Double lng2, Double lat2) throws Exception;

    /**
     * 通过Id查一个地点范围内的用户轨迹
     * @param id
     * @param lng1
     * @param lat1
     * @param lng2
     * @param lat2
     */
    List<Track> trackplaceid(Long id, Double lng1, Double lat1,
                                  Double lng2, Double lat2) throws Exception;

    List<Track> tracktimeplace(String time, Double lng1, Double lat1,
                               Double lng2, Double lat2) throws Exception;

    List<Track> tracktime1time2place(String time1,String time2,
                                     Double lng1, Double lat1, Double lng2, Double lat2) throws Exception;


    double findone(Long id1, Long id2);

    Boolean adjust(Long idt, Long ida);

    List<AreaArriveVO> inArea(List<Track> tracks1, Area area);

    List<AreaArriveVO> onetoone(Long id, Long ida);

    List<AreaArriveVO> onetomuch(Long ida);

    List<AreaArriveVO> muchtoone(Long id);

    List<AreaArriveVO> muchtomuch();

    /**
     * 避免冲突
     * 可能会被删除
     * @param id
     * @return
     */
    Area findonearea(Long id);

    Area findAreabyname(String name);

    List<Double> allareadis (Long id1);

    List<Double> areadis (Long id1, Double dis);

    List<String> areanamedis (Long id1, Double dis);

    List<CompareVO> areadistance (Long id1, Double dis);

    Boolean userconflict (Long id1, Long id2, Double dis, long time);

    List<String> usertrack (Long id1, Long id2, Double dis, long time);

    List<MeetVO> useraction (Long id1, Long id2, Double dis, long time);

    /*Boolean distance (Long id1, Long id2);
*/

}
